gtk_widget_get_preferred_height (widget, &minimum_height, &natural_height);
/* convert for_size to unadjusted height (for_size is a proposed allocation) */
- widget_class->adjust_size_allocation (widget,
- GTK_ORIENTATION_VERTICAL,
- &minimum_height,
- &natural_height,
- &ignored_position,
- &adjusted_for_size);
+ gtk_widget_adjust_size_allocation (widget,
+ GTK_ORIENTATION_VERTICAL,
+ &minimum_height,
+ &natural_height,
+ &ignored_position,
+ &adjusted_for_size);
push_recursion_check (widget, orientation, for_size);
widget_class->measure (widget,
gtk_widget_get_preferred_width (widget, &minimum_width, &natural_width);
/* convert for_size to unadjusted width (for_size is a proposed allocation) */
- widget_class->adjust_size_allocation (widget,
- GTK_ORIENTATION_HORIZONTAL,
- &minimum_width,
- &natural_width,
- &ignored_position,
- &adjusted_for_size);
+ gtk_widget_adjust_size_allocation (widget,
+ GTK_ORIENTATION_HORIZONTAL,
+ &minimum_width,
+ &natural_width,
+ &ignored_position,
+ &adjusted_for_size);
push_recursion_check (widget, orientation, for_size);
widget_class->measure (widget,
adjusted_min = min_size;
adjusted_natural = nat_size;
- widget_class->adjust_size_request (widget,
- orientation,
- &adjusted_min,
- &adjusted_natural);
+ gtk_widget_adjust_size_request (widget, orientation,
+ &adjusted_min, &adjusted_natural);
if (adjusted_min < min_size ||
adjusted_natural < nat_size)
nat_baseline = -1;
}
else
- widget_class->adjust_baseline_request (widget,
- &min_baseline,
- &nat_baseline);
+ gtk_widget_adjust_baseline_request (widget, &min_baseline, &nat_baseline);
}
_gtk_size_request_cache_commit (cache,
static void gtk_widget_queue_tooltip_query (GtkWidget *widget);
-static void gtk_widget_real_adjust_size_request (GtkWidget *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size);
-static void gtk_widget_real_adjust_baseline_request (GtkWidget *widget,
- gint *minimum_baseline,
- gint *natural_baseline);
-static void gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size,
- gint *allocated_pos,
- gint *allocated_size);
-static void gtk_widget_real_adjust_baseline_allocation (GtkWidget *widget,
- gint *baseline);
+static void gtk_widget_adjust_baseline_allocation (GtkWidget *widget,
+ gint *baseline);
static void template_data_free (GtkWidgetTemplate *template_data);
klass->priv->accessible_role = ATK_ROLE_INVALID;
klass->get_accessible = gtk_widget_real_get_accessible;
- klass->adjust_size_request = gtk_widget_real_adjust_size_request;
- klass->adjust_baseline_request = gtk_widget_real_adjust_baseline_request;
- klass->adjust_size_allocation = gtk_widget_real_adjust_size_allocation;
- klass->adjust_baseline_allocation = gtk_widget_real_adjust_baseline_allocation;
klass->queue_draw_region = gtk_widget_real_queue_draw_region;
klass->queue_draw_child = gtk_widget_real_queue_draw_child;
#endif
/* Now that we have the right natural height and width, go ahead and remove any margins from the
* allocated sizes and possibly limit them to the natural sizes */
- GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,
- GTK_ORIENTATION_HORIZONTAL,
- &dummy,
- &natural_width,
- &adjusted_allocation.x,
- &adjusted_allocation.width);
- GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,
- GTK_ORIENTATION_VERTICAL,
- &dummy,
- &natural_height,
- &adjusted_allocation.y,
- &adjusted_allocation.height);
+ gtk_widget_adjust_size_allocation (widget,
+ GTK_ORIENTATION_HORIZONTAL,
+ &dummy,
+ &natural_width,
+ &adjusted_allocation.x,
+ &adjusted_allocation.width);
+ gtk_widget_adjust_size_allocation (widget,
+ GTK_ORIENTATION_VERTICAL,
+ &dummy,
+ &natural_height,
+ &adjusted_allocation.y,
+ &adjusted_allocation.height);
if (baseline >= 0)
- GTK_WIDGET_GET_CLASS (widget)->adjust_baseline_allocation (widget,
- &baseline);
+ gtk_widget_adjust_baseline_allocation (widget, &baseline);
if (adjusted_allocation.x < real_allocation.x ||
adjusted_allocation.y < real_allocation.y ||
*allocated_size -= (start_margin + end_margin);
}
-static void
-gtk_widget_real_adjust_size_allocation (GtkWidget *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size,
- gint *allocated_pos,
- gint *allocated_size)
+void
+gtk_widget_adjust_size_allocation (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size,
+ gint *allocated_pos,
+ gint *allocated_size)
{
GtkWidgetPrivate *priv = widget->priv;
}
static void
-gtk_widget_real_adjust_baseline_allocation (GtkWidget *widget,
- gint *baseline)
+gtk_widget_adjust_baseline_allocation (GtkWidget *widget,
+ gint *baseline)
{
if (*baseline >= 0)
*baseline -= widget->priv->margin.top;
gtk_widget_set_realized (widget, FALSE);
}
-static void
-gtk_widget_real_adjust_size_request (GtkWidget *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size)
+void
+gtk_widget_adjust_size_request (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size)
{
GtkWidgetPrivate *priv = widget->priv;
}
}
-static void
-gtk_widget_real_adjust_baseline_request (GtkWidget *widget,
- gint *minimum_baseline,
- gint *natural_baseline)
+void
+gtk_widget_adjust_baseline_request (GtkWidget *widget,
+ gint *minimum_baseline,
+ gint *natural_baseline)
{
GtkWidgetPrivate *priv = widget->priv;
* widget; or emitted when widget got focus in keyboard mode.
* @compute_expand: Computes whether a container should give this
* widget extra space when possible.
- * @adjust_size_request: Convert an initial size request from a widget's
- * #GtkSizeRequestMode virtual method implementations into a size request to
- * be used by parent containers in laying out the widget.
- * adjust_size_request adjusts from a child widget's
- * original request to what a parent container should
- * use for layout. The @for_size argument will be -1 if the request should
- * not be for a particular size in the opposing orientation, i.e. if the
- * request is not height-for-width or width-for-height. If @for_size is
- * greater than -1, it is the proposed allocation in the opposing
- * orientation that we need the request for. Implementations of
- * adjust_size_request should chain up to the default implementation,
- * which applies #GtkWidget’s margin properties and imposes any values
- * from gtk_widget_set_size_request(). Chaining up should be last,
- * after your subclass adjusts the request, so
- * #GtkWidget can apply constraints and add the margin properly.
- * @adjust_size_allocation: Convert an initial size allocation assigned
- * by a #GtkContainer using gtk_widget_size_allocate(), into an actual
- * size allocation to be used by the widget. adjust_size_allocation
- * adjusts to a child widget’s actual allocation
- * from what a parent container computed for the
- * child. The adjusted allocation must be entirely within the original
- * allocation. In any custom implementation, chain up to the default
- * #GtkWidget implementation of this method, which applies the margin
- * and alignment properties of #GtkWidget. Chain up
- * before performing your own adjustments so your
- * own adjustments remove more allocation after the #GtkWidget base
- * class has already removed margin and alignment. The natural size
- * passed in should be adjusted in the same way as the allocated size,
- * which allows adjustments to perform alignments or other changes
- * based on natural size.
* @style_updated: Signal emitted when the GtkStyleContext of a widget
* is changed.
* @touch_event:
- * @adjust_baseline_request:
- * @adjust_baseline_allocation:
* @queue_draw_region: Invalidates the area of widget defined by
* region.
* @queue_draw_child: Child wants to be redrawn. The region given is in
gboolean *hexpand_p,
gboolean *vexpand_p);
- void (* adjust_size_request) (GtkWidget *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size);
- void (* adjust_size_allocation) (GtkWidget *widget,
- GtkOrientation orientation,
- gint *minimum_size,
- gint *natural_size,
- gint *allocated_pos,
- gint *allocated_size);
-
void (* style_updated) (GtkWidget *widget);
gboolean (* touch_event) (GtkWidget *widget,
GdkEventTouch *event);
- void (* adjust_baseline_request)(GtkWidget *widget,
- gint *minimum_baseline,
- gint *natural_baseline);
- void (* adjust_baseline_allocation) (GtkWidget *widget,
- gint *baseline);
void (* queue_draw_region) (GtkWidget *widget,
const cairo_region_t *region);
void (* queue_draw_child) (GtkWidget *widget,
void gtk_widget_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot);
+void gtk_widget_adjust_size_request (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size);
+void gtk_widget_adjust_size_allocation (GtkWidget *widget,
+ GtkOrientation orientation,
+ gint *minimum_size,
+ gint *natural_size,
+ gint *allocated_pos,
+ gint *allocated_size);
+void gtk_widget_adjust_baseline_request (GtkWidget *widget,
+ gint *minimum_baseline,
+ gint *natural_baseline);
/* inline getters */